Raised This Month: $51 Target: $400
 12% 

[L4D(2)]Infected Self Detonate


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ne0cha0s
Senior Member
Join Date: Mar 2010
Plugin ID:
1568
Plugin Version:
0.9
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows an infected player to detonate themselves by pressing a specified button (currently supports all infected classes)
    Unapprover:
    Reason for Unapproving:
    Author not actively participating anymore.
    Old 03-28-2010 , 06:12   [L4D(2)]Infected Self Detonate
    Reply With Quote #1

    Description:
    This plugin allows a player on the infected team to kill themselves by pressing a specified button (default: ZOOM). I only made the suicide possible for the infected I thought it might prove useful. Boomer of course so that while near a player, instead of getting melee'd away and proved useless, you can detonate yourself and get the bile all over them. Spitter suicide could be useful in a few different instances, perhaps you just used your spit, but still want to block a doorway so you can detonate yourself there, or perhaps on a downed survivor. Smoker I added for the people who have that dreaded smoker cloud, it could prove useful when survivors are trapped in a specific location.

    Now, just for convenience, it is possible for all special infected classes to self-detonate, although only the ones I thought it would prove useful for are enabled by default.

    CVARs:
    l4d_detonate_button - Specifies infected self-detonation button. 0 = no self-detonation, (default) 1 = ZOOM, 2 = RELOAD, 3 = MELEE

    l4d2_charger_detonate_on - Charger detonate is enabled or disabled. 1 = enabled

    l4d2_jockey_detonate_on - Jockey detonate is enabled or disabled. 1 = enabled

    l4d2_spitter_detonate_on - Spitter detonate enabled or disabled. 1 = enabled

    l4d_boomer_detonate_on - Boomer detonate is enabled or disabled. 1 = enabled

    l4d_hunter_detonate_on - Hunter detonate is enabled or disabled. 1 = enabled

    l4d_smoker_detonate_on - Smoker detonate is enabled or disabled. 1 = enabled

    l4d_tank_detonate_on - Tank detonate is enabled or disabled. 1 = enabled

    l4d_display_detonation - Sets whether or not to display when players self-detonate. 1 = enabled

    Problems:
    No more problems as far as I know. It's now tested and working for Left 4 Dead and Left 4 Dead 2.

    To-Dos:
    - add some cvars to allow customization - DONE!!!
    - add cvar to allow changing of which button suicides - DONE!!!
    - add cvar to allow delay for suicide - MIGHT NOT ADD
    - clean up code - DONE!!!
    - change code to not slap back the infected when they suicide - DONE!!!
    - fix any other bugs that come up
    - take suggestions?

    Info about the author:

    I have limited knowledge about programming, and this is the first time I've touched any source code in about 3 years, so bear with me. This is my first plugin, but I do not intend it to be my last, I run my own server and plan to make some more mods in the future. I'm going to be taking some programming classes when I move back home within the next week, and over the next couple months plan to get some more mods published.

    Plugin Versions:
    0.9 - Added cvar to allow people to select which key self-detonates
    0.8b - HUGE code cleanup thanks to dieteetasse
    0.8 - added cvar to allow displaying when a player detonates
    0.7 - not released
    - changed detonate key to the ZOOM key to avoid conflicts with other plugins
    0.7b - not released
    - experimental code to try and allow choosing which key detonates
    0.6 - not released
    - added cvar to support tank
    - code cleanup
    0.5b - fixed spawning with 1 health bug conflicting with other mods
    0.4 - added cvars for customization
    - now supports all infected classes (besides tank)
    - cleaned up and changed code
    0.3b - not released
    - cleaned up/changed some code to test
    0.2: - fixed boomer not knocking back players
    - fixed boomer not getting bile on players
    - thanks die ;D
    0.1: - initial release

    UPDATE TO VERSION 0.9:
    Make sure you delete your old l4d_infected_self_detonate.cfg before you update.

    Credit/Thanks:
    marvel - this plugin was inspired by his idea posted here: http://forums.alliedmods.net/showthread.php?t=122324

    DieTeetasse - his answering to my jockey making survivor jump request and me taking a look at some source code inspired me to get started on this, plus he posted some simple code that helped jump start this plugin.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_Infected_Self_Detonate.sp - 1836 views - 4.4 KB)
    __________________



    Last edited by ne0cha0s; 04-23-2010 at 09:57. Reason: updated plugin to version 0.9
    ne0cha0s is offline
    marvel
    BANNED
    Join Date: Dec 2009
    Old 03-28-2010 , 06:18   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #2

    Great! I will test this, thanks!
    marvel is offline
    ne0cha0s
    Senior Member
    Join Date: Mar 2010
    Old 03-28-2010 , 06:24   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #3

    no problem, i've done some testing, and so far could not get the boomer's explosion to bile the survivors. please post feedback for me. thanks.
    __________________


    ne0cha0s is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 06:42   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #4

    Quote:
    Originally Posted by ne0cha0s View Post
    no problem, i've done some testing, and so far could not get the boomer's explosion to bile the survivors. please post feedback for me. thanks.
    VALVe "hardcoded" it in. Boomers suiciding do not bile survivors. All you need to do is hook into the stumble hook, check if the initiator is on the infected team, then fake the stumbled players using the command "it". Of course you need to de-cheat it first. "it" basically biles whoever puts the command it.
    Geel9 is offline
    Geel9
    Senior Member
    Join Date: Mar 2009
    Old 03-28-2010 , 06:43   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #5

    If you'd like I could help you with the plugin.
    Geel9 is offline
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 03-28-2010 , 07:34   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #6

    you should add my ghost check code to prevent infected players kill themselves while in ghost mode
    alexip121093 is offline
    Send a message via MSN to alexip121093
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 03-28-2010 , 07:36   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #7

    Code:
    new propinfoghost;
     
    public OnPluginStart()
    {
    propinfoghost = FindSendPropInfo("CTerrorPlayer", "m_isGhost");
    }
     
    bool:IsPlayerSpawnGhost(client)
    {
     if(GetEntData(client, propinfoghost, 1)) return true;
     else return false;
    }
    
    if(IsPlayerSpawnGhost(client)) return;
    alexip121093 is offline
    Send a message via MSN to alexip121093
    alexip121093
    Senior Member
    Join Date: Dec 2009
    Location: Hong Kong
    Old 03-28-2010 , 07:38   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #8

    also
    IsPlayerAlive(client)
    should add in the plugin
    otherwise there are error
    Attached Files
    File Type: sp Get Plugin or Get Source (infdetonate.sp - 766 views - 3.3 KB)

    Last edited by alexip121093; 03-28-2010 at 07:59.
    alexip121093 is offline
    Send a message via MSN to alexip121093
    FaTony
    Veteran Member
    Join Date: Aug 2008
    Old 03-28-2010 , 10:50   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #9

    http://forums.alliedmods.net/showthr...ghlight=damage
    FaTony is offline
    ne0cha0s
    Senior Member
    Join Date: Mar 2010
    Old 03-28-2010 , 13:12   Re: [L4D(2)]Infected Self Detonate
    Reply With Quote #10

    Quote:
    Originally Posted by Geel9 View Post
    If you'd like I could help you with the plugin.
    i would love some help, like i said, i'm barely getting back into coding

    Quote:
    Originally Posted by alexip121093 View Post
    you should add my ghost check code to prevent infected players kill themselves while in ghost mode
    the code that i use doesn't allow them to kill themselves while a ghost

    Quote:
    Originally Posted by Geel9 View Post
    VALVe "hardcoded" it in. Boomers suiciding do not bile survivors. All you need to do is hook into the stumble hook, check if the initiator is on the infected team, then fake the stumbled players using the command "it". Of course you need to de-cheat it first. "it" basically biles whoever puts the command it.
    i didn't use the actual suicide code, i used the code to fake damage, but i guess i would have to make players stumble anyways to get the bile working
    __________________


    ne0cha0s is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:56.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode